{template 'header', 'member'}
<div id="head-bar">
<div class="head-bar">
<div class="head-bar-back">
<a href="{$back_link}" data-direction="reverse"><img src="{DT_MOB}static/img/icon-back.png" width="24" height="24"/><span>返回</span></a>
</div>
<div class="head-bar-title">{$head_name}</div>
<div class="head-bar-right">
<a href="{$back_link}" data-direction="reverse"><span>取消</span></a>
</div>
</div>
<div class="head-bar-fix"></div>
</div>

<form method="post" action="pay.php" data-ajax="false" id="pay_form" onsubmit="return pay_check();">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>

<div class="blank-20"></div>
<div class="list-set">
	<ul>
		<li><div><a href="{$forward}">{$title}</a></div></li>
		<li><div><span><b style="font-size:20px;color:#FF6600;">{$fee}</b>{$DT[money_unit]}</span>应付总额</div></li>
		{if $fee != $member_fee}<li><div><span><b style="font-size:20px;color:#FF6600;">{$member_fee}</b>{$DT[money_unit]}</span>会员价</div></li>{/if}
	</ul>
</div>

<div id="mymoney" style="display:none;">
	<div class="blank-20"></div>
	<div class="list-set">
		<ul>
			<li><div><span><b>{$_money}</b>{$DT[money_unit]}</span>账户余额</div></li>
		</ul>
	</div>
</div>

<div id="payword" style="display:none;">
	<div class="blank-20"></div>
	<div class="list-inp bd-t bd-b">
		<div><input type="password" name="password" id="password" placeholder="支付密码：" autocomplete="new-password" onblur="window.scrollTo(0,0);"/></div>
	</div>
</div>

<div id="paytype" style="display:none;">
	<div class="blank-20"></div>
	{php $PAYLIST = get_paylist();}
	<input type="hidden" name="bank" id="bank" value="{$PAYLIST[0][bank]}"/>
	<div class="list-pay">
		<ul>
		{loop $PAYLIST $k $v}
		<li onclick="var bk=$('#bank').val();if(bk=='{$v[bank]}'){return;}$('#check-'+bk).attr('class', 'check');$('#check-{$v[bank]}').attr('class', 'checked');$('#bank').val('{$v[bank]}');"><div><em class="{if $k}check{else}checked{/if}" id="check-{$v[bank]}"></em><img src="{DT_PATH}api/pay/{$v[bank]}/icon.png" width="24" height="24"/>{$v[name]} {if $v[percent]>0}<span>手续费 {$v[percent]}%</span>{/if}</div></li>
		{/loop}
		</ul>
	</div>
</div>

<div class="blank-20"></div>
<div class="list-btn"><input type="submit" name="submit" value="立即支付" class="btn-green"/></div>
<div class="blank-20"></div>
</form>
<script type="text/javascript">
var money = {$member_fee};
function pay_check() {
	if(money > {$_money}) {
		Go('charge.php?action=pay&reason=pay|{$mid}|{$itemid}&amount='+money+'&bank='+$('#bank').val());
		return false;
	}
	if(money > {$DT[quick_pay]}){
		if(Dd('password').value.length < 6) {
			Dmsg('请填写支付密码', 'password');
			return false;
		}
	}
	return true;
}
window.setInterval(
	function() {
		if(money > {$_money} || {$_money} < 0.01) {
			$('#mymoney').hide();$('#paytype').show();$('#payword').hide();
		} else {
			$('#mymoney').show();$('#paytype').hide();if(money > {$DT[quick_pay]}){$('#payword').show();}
		}
	}, 
500);
</script>
{template 'footer', 'member'}